package com.evildog.workspace.common.exception;


import com.evildog.workspace.common.intefaces.ICustomExceptionDesc;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.http.HttpStatus;

@EqualsAndHashCode(callSuper = true)
@Data
public class CommonException extends RuntimeException {
    private static final long serialVersionUID = 6801519635531297845L;

    protected String code;

    protected String errorMessage;

    protected HttpStatus httpStatus;

    public CommonException(ICustomExceptionDesc responseStatus, HttpStatus httpStatus) {
        super(responseStatus.getMessage());
        this.errorMessage = responseStatus.getMessage();
        this.code = responseStatus.getCode();
        this.httpStatus = httpStatus;
    }

}
